package com.sky.mapper;

import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Mapper
public interface ShoppingCartMapper {


    void update(ShoppingCart cart);

    void insert(ShoppingCart cart);

    List<ShoppingCart> select(HashMap map);

    @Delete("delete from shopping_cart where user_id = #{userId}")
    void clean(Long userId);

    void delete(HashMap map);

    @Delete("delete from shopping_cart where user_id = #{userId}")
    void deleteByUserId(Long userId);

    void insertBatch(List<ShoppingCart> shoppingCartList);
}
